package com.jieshuibao.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jieshuibao.mapper.VideoCardMapper;
import com.jieshuibao.model.db.VideoCard;
import com.jieshuibao.model.db.VideoCardExample;

@Service
public class VideoCardService{
	
	@Resource
	private VideoCardMapper videoCardMapper;
	
	public void addVideoCard(VideoCard videoCard) {
		videoCardMapper.insertSelective(videoCard);
	}
	
	public void delVideoCardByUuid(String uuid) {
		videoCardMapper.deleteByPrimaryKey(uuid);
	}
	
	public void updateVideoCard(VideoCard videoCard) {
		videoCardMapper.updateByPrimaryKeySelective(videoCard);
	}
	
	public void updateVideoCardByExample(VideoCard videoCard,VideoCardExample videoCardExample){
	    videoCardMapper.updateByExampleSelective(videoCard,videoCardExample);
	}
	
	public VideoCard getVideoCardByUuid(String uuid) {
		return videoCardMapper.selectByPrimaryKey(uuid);
	}
	
	public List<VideoCard> getPageVideoCard(VideoCardExample videoCardExample) {
		return videoCardMapper.selectPage(videoCardExample);
	}
	
	public int countVideoCard(VideoCardExample videoCardExample) {
		return videoCardMapper.countByExample(videoCardExample);
	}
	public List<VideoCard> selectByExample(VideoCardExample example){
	    return videoCardMapper.selectByExample(example);
	}
}
